home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13069 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: castle.nando.net!news
  2. From: actuary@nando.net  (Bill McCarthy)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Checking a file
  5. Date: 4 Apr 1996 09:18:15 GMT
  6. Organization: Nando.net Public Access
  7. Message-ID: <4k044n$fdp@castle.nando.net>
  8. References: <4jkvgq$i8g@raffles.technet.sg>
  9. Reply-To: actuary@nando.net (Bill McCarthy)
  10. NNTP-Posting-Host: grail1519.nando.net
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <4jkvgq$i8g@raffles.technet.sg>,
  14. leonard@pacific.net.sg (Leonard Sim) writes:
  15.  
  16. >    I am having some trouble trying to code this procedure, can somebody
  17. >please help me? The requirements of the procedure is as follows :
  18. >
  19. >There will be a text file containing records of users attempted logins
  20. >to a system. The format of the file is like this :
  21. >
  22. >USERID      DATE          TIME            REMARKS
  23. >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24. >USER01     19960331     131259       SUCCESSFUL
  25. >USER01     19960331     131441       SUCCESSFUL
  26. >USER02     19960331     131834       UNSUCCESSFUL
  27. >USER01     19960331     132000       SUCCESSFUL
  28. >
  29. >This procedure must scan through this file and pick up suspected
  30. >violation attempts, using a criterion of 3 or more successive
  31. >unsuccessful logon attempts. The violation attempts must then be
  32. >output into another data file.
  33. >
  34. >I hope somebody can help me??
  35.  
  36. You could use a structure containing an ID and a counter.
  37.  
  38. The first time an ID is used, set the counter to 0.  If the
  39. remark is a success, the counter is set to 0, otherwise it
  40. is incremented.
  41.  
  42. If the counter == 3, log an error.
  43.  
  44. Repeat the process until EOF is encountered.
  45.  
  46. Bill McCarthy
  47. actuary@nando.net
  48. Wendell, NC  USA
  49.  
  50.